package com.hong.controller;
import com.hong.entity.UserTest;
import com.hong.service.IUserTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


import org.springframework.web.bind.annotation.RestController;

/**
 *
 * 用户表22222 前端控制器
 * @author baomidou
 * @since 2024-08-03
 */

@RestController
@Api(value = "用户表22222-userTest", tags = {"用户表22222-userTest"})
@RequestMapping("/user-test")
public class UserTestController {
    @Autowired
    private IUserTestService userTestService;

    @GetMapping("/list")
    @ApiOperation(value = "用户表22222列表查询",notes = "list")
    public List<UserTest> list(){
        return userTestService.list();
    }

    @GetMapping("/detail")
    @ApiOperation(value = "用户表22222查看详情",notes = "UserTest")
    public UserTest getUserTestById(Long id){
            return userTestService.getById(id);
    }

    @PostMapping("/save")
    @ApiOperation(value = "用户表22222新增",notes = "UserTest")
    public boolean saveUserTest(UserTest userTest){
            return userTestService.save(userTest);
    }

    @PostMapping("/saveOrUpdate")
    @ApiOperation(value = "用户表22222新增/修改",notes = "UserTest")
    public boolean saveOrUpdate(UserTest userTest){
            return userTestService.saveOrUpdate(userTest);
    }

    @PostMapping("/修改")
    @ApiOperation(value = "用户表22222修改",notes = "UserTest")
    public boolean update(UserTest userTest){
        return userTestService.updateById(userTest);
    }

    @PostMapping("/remove")
    @ApiOperation(value = "用户表22222删除",notes = "UserTest")
    public boolean remove(Long id){
        return userTestService.removeById(id);
    }

}
